<?php
declare(strict_types=1);

namespace LowCode\Naive;

use LowCode\Support\JsExp;

/**
 * a 标签 组件
 * @method static static make(mixed $children = null) Link组件
 */
class Link extends Button
{
    /**
     * @param mixed|null $children
     */
    public function __construct(mixed $children = null)
    {
        parent::__construct($children);
        $this->href("JavaScript:void(0);");
    }

    /**
     * href链接跳转
     * @param string|JsExp $href
     * @return $this
     */
    public function href(string|JsExp $href = ""): static
    {
        return $this->prop("href",$href);
    }

    /**
     * target 跳转方式
     * @param string|JsExp $target
     * @return $this
     */
    public function target(string|JsExp $target = "_blank" |"_self" | "_parent" | "_top"): static
    {
        return $this->prop("target",$target);
    }

}
